package com.gyg.returns;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author gyg
 * @version V1.0.0
 * @description:
 * @date 2021/02/07 09:08
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RespTable<T> {
    private Integer code;
    private String message;
    private T data;
    private long count;

    public RespTable(RespCode rc, T data, long count) {
        this.code = rc.getCode();
        this.message = rc.getMessage();
        this.data = data;
        this.count = count;
    }

    public RespTable(RespCode rc){
        this.code = rc.getCode();
        this.message = rc.getMessage();
    }

    public RespTable(Integer code, String msg){
        this.code = code;
        this.message = msg;
    }
}
